'use strict';
import React, {Component, PropTypes} from 'react';
import { connect } from 'react-redux';
import Sidebar from '../Sidebar/index'

class MainArea extends Component {
    constructor(props) {
        super(props);
    }
    render() {
        let {title,left} = this.props;
        left = left ? parseInt(left) : -200;
        return (
            <div className="container" style={{left: left}}>
                <div className="aside">
                    <Sidebar />
                    <a href="javascript:;" className="btn-fold-menu retract">展开</a>
                </div>
                <div className="main">
                    <div className="manage-area">
                        <span>
                              <div className="manage-area-title">
                                  <h2>{title}</h2>
                              </div>
                              <div className="manage-area-main">
                                  <div className="work-order-box">
                                      {this.props.children}
                                  </div>
                              </div>
                          </span>
                    </div>
                </div>
            </div>
        )
    }
}
MainArea.propTypes = {
    title:PropTypes.string.isRequired
};

export default MainArea;
